import { ToolTipItem } from "../../../../com/mui/manager/ToolTipItem";
import { GTextFormat } from "../../../common/GTextFormat";
import { FontUtil } from "../../../common/font/FontUtil";
import { ObjCreate } from "../common/ObjCreate";
import { ImagesConst } from "../../resource/ImagesConst";
import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
import { EffectManager } from "../../manager/EffectManager";
import { DisplayUtil } from "../../../common/DisplayUtil";
import { Language } from "../../../../extend/language/Language";
import { GTextFiled } from "../../../../com/mui/controls/GTextFiled";
import { LineBox } from "../guide/LineBox";
type int = number;
//class ChunlianChItem
    
    export  class ChunlianChItem extends ToolTipItem
    {
        constructor()
        {
            super();
            this._tft = new GTextFormat(FontUtil.stXingkaiName, 48, 16773632, true);
            this._bgBitmap = ObjCreate.createGBitmap(ImagesConst.WordRedBg, 0, 0, this);
            this._wordTxt = ObjCreate.createGTextField("", 0, 0, 55, 52, this, this._tft);
            this._wordTxt.autoSize = flash.text.TextFieldAutoSize.CENTER;
            this._wordTxt.mouseEnabled = false;
            this.buttonMode = true;
            this.useHandCursor = true;
            return;
        }

        public get index(): int
        {
            return this._index;
        }

        public set index(arg1: int)
        {
            this._index = arg1;
            return;
        }

        public get enable(): Boolean
        {
            return this._enable;
        }

        public set enable(arg1: Boolean)
        {
            this._enable = arg1;
            if (this.enable) 
            {
                this._bgBitmap.bitmapData = GlobalClass.getBitmapData(ImagesConst.WordRedBg);
            }
            else 
            {
                this._bgBitmap.bitmapData = GlobalClass.getBitmapData(ImagesConst.WordGrayBg);
            }
            return;
        }

        public get selected(): Boolean
        {
            return this._selected;
        }

        public set selected(arg1: Boolean)
        {
            this._selected = arg1;
            if (this.selected) 
            {
                if (!this._lineBox) 
                {
                    this._lineBox = EffectManager.getLineBox(57, 55, [6350622], 0.5, 2);
                }
                if (!this.contains(this._lineBox)) 
                {
                    this.addChild(this._lineBox);
                }
            }
            else 
            {
                DisplayUtil.removeMe(this._lineBox);
            }
            return;
        }

        public get word(): string
        {
            return this._word;
        }

        public set word(arg1: string)
        {
            this._word = arg1;
            this._wordTxt.text = arg1;
            return;
        }

        public /* override */ get toolTipData()
        {
            return Language.getString(58005);
        }

        /* internal */ /* var */_wordTxt: GTextFiled;

        /* internal */ /* var */_tft: GTextFormat;

        /* internal */ /* var */_lineBox: LineBox;

        /* internal */ /* var */_bgBitmap: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_word: string;

        /* internal */ /* var */_selected: Boolean;

        /* internal */ /* var */_enable: Boolean;

        /* internal */ /* var */_index: int;
    }
